(function ($){ "use strict"; var extcf7_show_animation={ "height": "show", "marginTop": "show", "marginBottom": "show", "paddingTop": "show", "paddingBottom": "show" }; var extcf7_hide_animation={ "height": "hide", "marginTop": "hide", "marginBottom": "hide", "paddingTop": "hide", "paddingBottom": "hide" }; var extcf7_animation_status=extcf7_conditional_settings.animitation_status; var extcf7_animation_intime=parseInt(extcf7_conditional_settings.animitation_in_time); var extcf7_animation_out_time=parseInt(extcf7_conditional_settings.animitation_out_time); var condition_depends_field=[]; function extcf7_global(){ $('.wpcf7-form').each(function(){ var options_element=$(this).find('input[name="_extcf7_conditional_options"]').eq(0); if(!options_element.length||!options_element.val()){ return false; } var form_options=JSON.parse(options_element.val()); form_options.conditions.forEach(function(form_item,i){ var rule_applied_field=$('[data-id="'+form_item.rule_applied_field+'"]'); form_item.and_condition_rules.forEach(function(rules,j){ if(!condition_depends_field.includes(rules.if_field_input)){ condition_depends_field.push(rules.if_field_input); } var from_field_selector=extcf7_input_checkbox_name(rules.if_field_input); var tag=from_field_selector.get(0); extcf7_check_condition(form_item.and_condition_rules, rule_applied_field); if(tag.tagName=='INPUT'){ var input_attr_type=from_field_selector.attr('type'); if(input_attr_type=='text'){ from_field_selector.on('keyup',function(){ extcf7_check_condition(form_item.and_condition_rules,rule_applied_field); }); }else if(input_attr_type=='email'){ from_field_selector.on('keyup',function(){ extcf7_check_condition(form_item.and_condition_rules,rule_applied_field); }); }else if(input_attr_type=='radio'){ from_field_selector.on('change',function(){ extcf7_check_condition(form_item.and_condition_rules,rule_applied_field); }); }else if(input_attr_type=='checkbox'){ from_field_selector.on('change',function(){ extcf7_check_condition(form_item.and_condition_rules,rule_applied_field); }); }}else if(tag.tagName=='SELECT'){ from_field_selector.on('change',function(){ extcf7_check_condition(form_item.and_condition_rules,rule_applied_field); }); }else if(tag.tagName=='TEXTAREA'){ from_field_selector.on('keyup',function(){ extcf7_check_condition(form_item.and_condition_rules,rule_applied_field); }); }}); }); }); } function extcf7_check_condition(coditions_rules,rule_applied_field){ var condition_status=extcf7_is_condition_ok(coditions_rules); if(condition_status){ if('on'==extcf7_animation_status){ rule_applied_field.animate(extcf7_show_animation, extcf7_animation_intime); }else{ rule_applied_field.show(); }}else{ if(rule_applied_field.data('clear')!==undefined){ clear_fied_on_hide(rule_applied_field); } if('on'==extcf7_animation_status){ rule_applied_field.animate(extcf7_hide_animation, extcf7_animation_out_time); }else{ rule_applied_field.hide(); }} } function extcf7_input_checkbox_name(from_field_selector){ var input_tag=$(`[name="${from_field_selector}"]`); if(typeof input_tag.get(0)==="undefined"){ input_tag=$(`[name="${from_field_selector}[]"]`); } return input_tag; } function extcf7_is_condition_ok(conditions){ var condition_status; var conditon_length=conditions.length; var pre_input_val; var current_input_val; var pre_cnd; var current_cnd; var next_input_val; var next_cnd; for (var k=0; k < conditon_length; k++){ if('and'==conditions[k].if_type_input||'or'==conditions[k].if_type_input){ pre_input_val=extcf7_get_input_val(conditions[k-1]); current_input_val=extcf7_get_input_val(conditions[k]); pre_cnd=extcf7_compare_condition(conditions[k-1], pre_input_val); current_cnd=extcf7_compare_condition(conditions[k], current_input_val); if(k < conditon_length - 1){ next_input_val=extcf7_get_input_val(conditions[k+1]); next_cnd=extcf7_compare_condition(conditions[k+1], next_input_val); }} if(!conditions[k].if_type_input){ var if_field_input_value=extcf7_get_input_val(conditions[k]); var field_value_status=extcf7_compare_condition(conditions[k],if_field_input_value); if(conditon_length > 1){ condition_status=extcf7_1st_cnd_method(conditions,field_value_status); return condition_status; break; }else{ condition_status=field_value_status; }}else if('and'==conditions[k].if_type_input){ if(conditions[k+1].if_type_input=='and'){ condition_status=pre_cnd&¤t_cnd&&next_cnd ? true:false; }else{ condition_status=(pre_cnd&¤t_cnd)||next_cnd ? true:false; }}else if('or'==conditions[k].if_type_input){ if(conditions[k+1].if_type_input=='and'){ condition_status=(pre_cnd||current_cnd)&&next_cnd ? true:false; }else{ condition_status=(pre_cnd||current_cnd)||next_cnd ? true:false; }} } return condition_status; } function extcf7_1st_cnd_method(conditions,first_value_status){ var cnd_status=first_value_status; var input_value; var value_status; for (var i=1; i < conditions.length; i++){ input_value=extcf7_get_input_val(conditions[i]); value_status=extcf7_compare_condition(conditions[i],input_value); if(conditions[i].if_type_input=='and'){ cnd_status=cnd_status&&value_status; }else{ cnd_status=cnd_status||value_status; }} return cnd_status; } function extcf7_compare_condition(rules,input_value){ if(rules.operator_input=="equal"){ if(input_value==rules.if_value_input){ return true; }}else if(rules.operator_input=="not-equal"){ if(input_value!=rules.if_value_input){ return true; }} return false; } function extcf7_get_input_val(rules){ var if_input_value; var if_input_selector=extcf7_input_checkbox_name(rules.if_field_input); if(if_input_selector.get(0).tagName=='INPUT'&&if_input_selector.attr('type')=='checkbox'){ if(if_input_selector.prop("checked")==true){ if_input_value="checked" }else if(if_input_selector.prop("checked")==false){ if_input_value="unchecked" }}else if(if_input_selector.get(0).tagName=='INPUT'&&if_input_selector.attr('type')=='radio'){ var radio_selector=$(':input[value="'+rules.if_value_input+'"]'); if(radio_selector.prop("checked")){ if_input_value=radio_selector.val(); }}else{ if_input_value=if_input_selector.val(); } return if_input_value; } function clear_fied_on_hide(rule_applied_field){ var $inputs=$(':input', rule_applied_field).not(':button, :submit, :reset, :hidden'); $inputs.each(function(){ var $this=$(this); $this.val(this.defaultValue); $this.prop('checked', this.defaultChecked); if(condition_depends_field.includes($this.attr('name'))){ $this.trigger("change"); $this.trigger("keyup"); }}); $('textarea', rule_applied_field).each(function(){ var $this=$(this); $this.val(this.defaultValue); if(condition_depends_field.includes($this.attr('name'))){ $this.trigger("keyup"); }}); $('select', rule_applied_field).each(function(){ var $this=$(this); if($this.val()===null){ $this.val($("option:first",$this).val()); if(condition_depends_field.includes($this.attr('name'))){ $this.trigger("change"); }} }); } extcf7_global(); if('true'===extcf7_conditional_settings.elementor_editor_mode){ $(window).on('elementor/frontend/init', function (){ elementorFrontend.hooks.addAction('frontend/element_ready/widget', function($scope, $){ extcf7_global(); }); }); }})(jQuery); (function ($){ "use strict"; var redirection_enable='off'; var redirection_url=''; var page_form_id=''; var redirect_form_id=''; var redirect_options=''; document.addEventListener('wpcf7submit', function(event){ page_form_id=$(event.target).find('input[name="_wpcf7"]').eq(0).val(); var get_options=$(event.target).find('input[name="_extcf7_redirect_options"]').eq(0).val(); if(get_options){ var option_values=JSON.parse(get_options); redirect_form_id=option_values.form_id; redirect_options=option_values.redirect_options; if(redirect_options){ redirection_enable=redirect_options.redirection_enable; redirection_url='off'==redirect_options.custom_url_enable ? redirect_options.redirect_page:extcf7_get_custom_url(redirect_options.custom_urle); }} }, false); document.addEventListener('wpcf7mailsent', function (event){ var redirect_delay=parseInt(extcf7_redirection_settings.redirection_delay); setTimeout(function(){ if('off'==redirection_enable&&page_form_id==redirect_form_id){ return; } if('on'==redirect_options.js_action){ if(redirect_options.javascript_code){ eval(redirect_options.javascript_code); }} if('off'==redirect_options.redirect_new_tab){ window.location=redirection_url; }else{ window.open(redirection_url); }}, redirect_delay); }, false); function extcf7_get_custom_url(url){ var url_input=/\[(.*?)\]/g.test(url); if(!url_input){ return url; } var redirect_url=""; var url_inputs=url.match(/\[(.*?)\]/g); var url_inputs_names=[]; var i=0; url_inputs.forEach(function(item, index){ url_inputs_names.push(item.replace("[", "").replace("]", "")); }); url_inputs_names.forEach(function(item, index){ var inputs_val; var inputs_tag=$(`[name="${item}"]`).get(0).tagName; if(inputs_tag=='INPUT'){ var input_attr_type=$(`[name="${item}"]`).attr('type'); if(input_attr_type=='text'){ inputs_val=$('input[name="'+item+'"]').val(); }else if(input_attr_type=='radio'){ inputs_val=$('input[name="'+item+'"]:checked').val(); }}else if(inputs_tag=='SELECT'){ inputs_val=$('select[name="'+item+'"] option').filter(':selected').val(); } redirect_url=url.replace(url_inputs[i], inputs_val); url=redirect_url; i++; }); return url; }})(jQuery); (function(){ document.addEventListener('DOMContentLoaded', function(event){ wpcf7_recaptcha.execute=function(action){ grecaptcha.execute(wpcf7_recaptcha.sitekey, { action: action } ).then(function(token){ var event=new CustomEvent('wpcf7grecaptchaexecuted', { detail: { action: action, token: token, }, }); document.dispatchEvent(event); }); }; wpcf7_recaptcha.execute_on_homepage=function(){ wpcf7_recaptcha.execute(wpcf7_recaptcha.actions[ 'homepage' ]); }; wpcf7_recaptcha.execute_on_contactform=function(){ wpcf7_recaptcha.execute(wpcf7_recaptcha.actions[ 'contactform' ]); }; grecaptcha.ready(wpcf7_recaptcha.execute_on_homepage ); document.addEventListener('change', wpcf7_recaptcha.execute_on_contactform ); document.addEventListener('wpcf7submit', wpcf7_recaptcha.execute_on_homepage ); }); document.addEventListener('wpcf7grecaptchaexecuted', function(event){ var fields=document.querySelectorAll("form.wpcf7-form input[name='_wpcf7_recaptcha_response']" ); for(var i=0; i < fields.length; i++){ var field=fields[ i ]; field.setAttribute('value', event.detail.token); }}); })(); window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o form').each(function(){ var $form=$(this); wpcf7.initForm($form); if(wpcf7.cached){ wpcf7.refill($form); }}); }); wpcf7.getId=function(form){ return parseInt($('input[name="_wpcf7"]', form).val(), 10); }; wpcf7.initForm=function(form){ var $form=$(form); wpcf7.setStatus($form, 'init'); $form.submit(function(event){ if(! wpcf7.supportHtml5.placeholder){ $('[placeholder].placeheld', $form).each(function(i, n){ $(n).val('').removeClass('placeheld'); }); } if(typeof window.FormData==='function'){ wpcf7.submit($form); event.preventDefault(); }}); $('.wpcf7-submit', $form).after(''); wpcf7.toggleSubmit($form); $form.on('click', '.wpcf7-acceptance', function(){ wpcf7.toggleSubmit($form); }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){ var name=$(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); $('.wpcf7-list-item.has-free-text', $form).each(function(){ var $freetext=$(':input.wpcf7-free-text', this); var $wrap=$(this).closest('.wpcf7-form-control'); if($(':checkbox, :radio', this).is(':checked')){ $freetext.prop('disabled', false); }else{ $freetext.prop('disabled', true); } $wrap.on('change', ':checkbox, :radio', function(){ var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio'); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); if(! wpcf7.supportHtml5.placeholder){ $('[placeholder]', $form).each(function(){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function(){ if($(this).hasClass('placeheld')){ $(this).val('').removeClass('placeheld'); }}); $(this).blur(function(){ if(''===$(this).val()){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); }}); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){ $form.find('input.wpcf7-date[type="date"]').each(function(){ $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){ $form.find('input.wpcf7-number[type="number"]').each(function(){ $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }); }); } wpcf7.resetCounter($form); $form.on('change', '.wpcf7-validates-as-url', function(){ var val=$.trim($(this).val()); if(val && ! val.match(/^[a-z][a-z0-9.+-]*:/i) && -1!==val.indexOf('.')){ val=val.replace(/^\/+/, ''); val='http://' + val; } $(this).val(val); }); }; wpcf7.submit=function(form){ if(typeof window.FormData!=='function'){ return; } var $form=$(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7.clearResponse($form); var formData=new FormData($form.get(0)); var detail={ id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field){ if('_wpcf7'==field.name){ detail.contactFormId=field.value; }else if('_wpcf7_version'==field.name){ detail.pluginVersion=field.value; }else if('_wpcf7_locale'==field.name){ detail.contactFormLocale=field.value; }else if('_wpcf7_unit_tag'==field.name){ detail.unitTag=field.value; }else if('_wpcf7_container_post'==field.name){ detail.containerPostId=field.value; }else if(field.name.match(/^_/)){ }else{ detail.inputs.push(field); }}); wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess=function(data, status, xhr, $form){ detail.id=$(data.into).attr('id'); detail.status=data.status; detail.apiResponse=data; switch(data.status){ case 'init': wpcf7.setStatus($form, 'init'); break; case 'validation_failed': $.each(data.invalid_fields, function(i, n){ $(n.into, $form).each(function(){ wpcf7.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('.wpcf7-form-control', this).attr('aria-describedby', n.error_id ); $('[aria-invalid]', this).attr('aria-invalid', 'true'); }); }); wpcf7.setStatus($form, 'invalid'); wpcf7.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': wpcf7.setStatus($form, 'unaccepted'); wpcf7.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': wpcf7.setStatus($form, 'spam'); wpcf7.triggerEvent(data.into, 'spam', detail); break; case 'aborted': wpcf7.setStatus($form, 'aborted'); wpcf7.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': wpcf7.setStatus($form, 'sent'); wpcf7.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': wpcf7.setStatus($form, 'failed'); wpcf7.triggerEvent(data.into, 'mailfailed', detail); break; default: wpcf7.setStatus($form, 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-') ); } wpcf7.refill($form, data); wpcf7.triggerEvent(data.into, 'submit', detail); if('mail_sent'==data.status){ $form.each(function(){ this.reset(); }); wpcf7.toggleSubmit($form); wpcf7.resetCounter($form); } if(! wpcf7.supportHtml5.placeholder){ $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val($(n).attr('placeholder')); }); } $('.wpcf7-response-output', $form) .html('').append(data.message).slideDown('fast'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function(){ var $response=$(this); $('[role="status"]', $response).html(data.message); if(data.invalid_fields){ $.each(data.invalid_fields, function(i, n){ if(n.idref){ var $li=$('
  • ').append($('').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$('
  • ').append(n.message); } $li.attr('id', n.error_id); $('ul', $response).append($li); }); }}); if(data.posted_data_hash){ $form.find('input[name="_wpcf7_posted_data_hash"]').first() .val(data.posted_data_hash); }}; $.ajax({ type: 'POST', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: false, contentType: false }).done(function(data, status, xhr){ ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); }).fail(function(xhr, status, error){ var $e=$('
    ').text(error.message); $form.after($e); }); }; wpcf7.triggerEvent=function(target, name, detail){ var event=new CustomEvent('wpcf7' + name, { bubbles: true, detail: detail }); $(target).get(0).dispatchEvent(event); }; wpcf7.setStatus=function(form, status){ var $form=$(form); var prevStatus=$form.attr('data-status'); $form.data('status', status); $form.addClass(status); $form.attr('data-status', status); if(prevStatus&&prevStatus!==status){ $form.removeClass(prevStatus); }} wpcf7.toggleSubmit=function(form, state){ var $form=$(form); var $submit=$('input:submit', $form); if(typeof state!=='undefined'){ $submit.prop('disabled', ! state); return; } if($form.hasClass('wpcf7-acceptance-as-validation')){ return; } $submit.prop('disabled', false); $('.wpcf7-acceptance', $form).each(function(){ var $span=$(this); var $input=$('input:checkbox', $span); if(! $span.hasClass('optional')){ if($span.hasClass('invert')&&$input.is(':checked') || ! $span.hasClass('invert')&&! $input.is(':checked')){ $submit.prop('disabled', true); return false; }} }); }; wpcf7.resetCounter=function(form){ var $form=$(form); $('.wpcf7-character-count', $form).each(function(){ var $count=$(this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt($count.attr('data-starting-value'), 10); var maximum=parseInt($count.attr('data-maximum-value'), 10); var minimum=parseInt($count.attr('data-minimum-value'), 10); var updateCount=function(target){ var $target=$(target); var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum&&maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum&&length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $(':input[name="' + name + '"]', $form).each(function(){ updateCount(this); $(this).keyup(function(){ updateCount(this); }); }); }); }; wpcf7.notValidTip=function(target, message){ var $target=$(target); $('.wpcf7-not-valid-tip', $target).remove(); $('').attr({ 'class': 'wpcf7-not-valid-tip', 'aria-hidden': 'true', }).text(message).appendTo($target); if($target.is('.use-floating-validation-tip *')){ var fadeOut=function(target){ $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function(){ $(this).css({ 'z-index': -100 }); }); }; $target.on('mouseover', '.wpcf7-not-valid-tip', function(){ fadeOut(this); }); $target.on('focus', ':input', function(){ fadeOut($('.wpcf7-not-valid-tip', $target)); }); }}; wpcf7.refill=function(form, data){ var $form=$(form); var refillCaptcha=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]); }); }; var refillQuiz=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]); }); }; if(typeof data==='undefined'){ $.ajax({ type: 'GET', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'), beforeSend: function(xhr){ var nonce=$form.find(':input[name="_wpnonce"]').val(); if(nonce){ xhr.setRequestHeader('X-WP-Nonce', nonce); }}, dataType: 'json' }).done(function(data, status, xhr){ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }}); }else{ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }} }; wpcf7.clearResponse=function(form){ var $form=$(form); $form.siblings('.screen-reader-response').each(function(){ $('[role="status"]', this).html(''); $('ul', this).html(''); }); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form).hide().empty(); }; wpcf7.apiSettings.getRoute=function(path){ var url=wpcf7.apiSettings.root; url=url.replace(wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path); return url; };})(jQuery); (function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); !function (t){ var e={}; function i(n){ if(e[n]) return e[n].exports; var o=e[n]={i: n, l: !1, exports: {}}; return t[n].call(o.exports, o, o.exports, i), o.l = !0, o.exports } i.m=t, i.c=e, i.d=function (t, e, n){ i.o(t, e)||Object.defineProperty(t, e, {configurable: !1, enumerable: !0, get: n}) }, i.n=function (t){ var e=t&&t.__esModule ? function (){ return t.default }:function (){ return t }; return i.d(e, "a", e), e }, i.o=function (t, e){ return Object.prototype.hasOwnProperty.call(t, e) }, i.p="/", i(i.s=10); }({ 10: function (t, e, i){ i(11), t.exports=i(12) }, 11: function (t, e){ !function (t){ var e=chaty_settings; var country_name=""; var widget_status=false; var activeIndexID=0; var currentCountryCount=""; var isChatyInMobile=false; var exitIntentStatus=false; var pageScrollStatus=false; var timeIntervalStatus=false; var maxTimeInterval=0; var chatyFunctionLoaded=false; var isBoatUser=false; function i(t){ for (var e=t + "=", i=document.cookie.split(";"), n=0; n < i.length; n++){ for (var o=i[n]; " "==o.charAt(0);) o=o.substring(1); if(0==o.indexOf(e)) return o.substring(e.length, o.length) } return "" } function check_for_widget_data(index){ activeIndexID=index; if(index < e.chaty_widgets.length){ if(e.chaty_widgets[index].countries.length > 0){ if(country_name==""){ var $ipurl='https://www.cloudflare.com/cdn-cgi/trace'; jQuery.get($ipurl, function (cloudflaredata){ var currentCountry=cloudflaredata.match("loc=(.*)"); if(currentCountry.length > 1){ currentCountry=currentCountry[1]; if(currentCountry){ currentCountry=currentCountry.toUpperCase(); country_name=currentCountry; if(jQuery.inArray(currentCountry, e.chaty_widgets[activeIndexID].countries)!=-1){ set_widget_data(activeIndexID); }} currentCountryCount++; setTimeout(function(){ check_for_widget_data(currentCountryCount); },25); }}); }else{ if(jQuery.inArray(country_name, e.chaty_widgets[activeIndexID].countries)!=-1){ set_widget_data(activeIndexID); } currentCountryCount++; setTimeout(function(){ check_for_widget_data(currentCountryCount); },10); }}else{ set_widget_data(index); currentCountryCount++; setTimeout(function(){ check_for_widget_data(currentCountryCount); },10); }} } if(e.chaty_widgets.length > 0){ if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4))){ isChatyInMobile=true; } if(isChatyInMobile){ jQuery("body").addClass("chaty-in-mobile"); }else{ jQuery("body").addClass("chaty-in-desktop"); } var botPattern="(googlebot\/|bot|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)"; var re=new RegExp(botPattern, 'i'); var userAgent=navigator.userAgent; if(re.test(userAgent)){ isBoatUser=true; } currentCountryCount=0; check_for_widget_data(currentCountryCount); } function set_widget_data(index){ widget_status=false; for(var i=0; i"; htmlString +=""; jQuery("body").append(htmlString); var thisIndex=jQuery(this).closest(".chaty-widget").attr("data-index"); if(chaty_settings.chaty_widgets[thisIndex]['mode']=="horizontal"){ jQuery(".wechat-qr-code").css("bottom", (parseInt(chaty_settings.chaty_widgets[thisIndex]['bot'])+parseInt(chaty_settings.chaty_widgets[thisIndex]['widget_size'])+25)+"px"); if(chaty_settings.chaty_widgets[thisIndex]['pos_side']=="right"){ jQuery(".wechat-qr-code").css("left", "auto").css("right", chaty_settings.chaty_widgets[thisIndex]['side']+"px"); }else{ jQuery(".wechat-qr-code").css("right", "auto").css("left", chaty_settings.chaty_widgets[thisIndex]['side']+"px"); }}else{ jQuery(".wechat-qr-code").css("bottom", parseInt(chaty_settings.chaty_widgets[thisIndex]['bot'])+"px"); if(chaty_settings.chaty_widgets[thisIndex]['pos_side']=="right"){ jQuery(".wechat-qr-code").css("left", "auto").css("right", (parseInt(chaty_settings.chaty_widgets[thisIndex]['side'])+parseInt(chaty_settings.chaty_widgets[thisIndex]['widget_size'])+25)+"px"); }else{ jQuery(".wechat-qr-code").css("right", "auto").css("left", (parseInt(chaty_settings.chaty_widgets[thisIndex]['side'])+parseInt(chaty_settings.chaty_widgets[thisIndex]['widget_size'])+25)+"px"); }} }}); jQuery(document).on("click", ".i-trigger .i-trigger-open", function(){ if(!isBoatUser){ var widget_index=jQuery(this).closest(".chaty-widget").attr("data-index"); var widgetIndex=chaty_settings.chaty_widgets[widget_index].widget_index; var widgetNonce=chaty_settings.chaty_widgets[widget_index].widget_nonce; var isExpired=check_chaty_cookie_expired("wcf"+widgetIndex); if(isExpired){ save_chaty_cookie_string("wcf"+widgetIndex); jQuery.ajax({ url: chaty_settings.ajax_url, data: "index=" + widgetIndex + "&nonce=" + widgetNonce + "&is_widget=1&channel=&type=click&action=update_chaty_channel_status", type: 'post', async: true, defer: true, success: function (){ }}); }} }); jQuery(document).on("click", ".chaty-main-widget", function(){ if(!isBoatUser){ if(!jQuery(this).closest(".chaty-widget").hasClass("one_widget")){ var widget_index=jQuery(this).closest(".chaty-widget").attr("data-index"); var widgetIndex=chaty_settings.chaty_widgets[widget_index].widget_index; var widgetNonce=jQuery(this).attr("data-nonce"); var widgetChannel=jQuery(this).attr("data-channel"); if(check_chaty_cookie_expired("wcf"+widgetIndex+"_"+widgetChannel)){ save_chaty_cookie_string("wcf"+widgetIndex+"_"+widgetChannel); jQuery.ajax({ url: chaty_settings.ajax_url, data: "index=" + widgetIndex + "&nonce=" + widgetNonce + "&is_widget=0&channel=" + widgetChannel + "&type=click&action=update_chaty_channel_status", type: 'post', async: true, defer: true, success: function (){ }}); }}else{ var widget_index=jQuery(this).closest(".chaty-widget").attr("data-index"); var widgetIndex=chaty_settings.chaty_widgets[widget_index].widget_index; var widgetNonce=chaty_settings.chaty_widgets[widget_index].widget_nonce; var widgetChannel=jQuery(this).attr("data-channel"); var clickStatus=check_chaty_cookie_expired("wcf"+widgetIndex+"_"+widgetChannel); if(clickStatus){ save_chaty_cookie_string("wcf"+widgetIndex+"_"+widgetChannel); } var widgetStatus=check_chaty_cookie_expired("wcf"+widgetIndex); var is_widget=0; if(widgetStatus){ is_widget=1; save_chaty_cookie_string("wcf"+widgetIndex); } if(is_widget||clickStatus){ jQuery.ajax({ url: chaty_settings.ajax_url, data: "index=" + widgetIndex + "&nonce=" + widgetNonce + "&is_widget=" + is_widget + "&channel=" + widgetChannel + "&type=click&action=update_chaty_channel_status", type: 'post', async: true, defer: true, success: function (){ }}); }} }}); } set_trigger_variables(); if(pageScrollStatus){ page_scroll_functions(); } if(timeIntervalStatus){ time_interval_function(); } if(exitIntentStatus){ exit_intent_function(); }} jQuery(window).resize(function(){ set_chaty_widget_size(); }); function set_chaty_channels(thisIndex){ if(isChatyInMobile){ jQuery(".chaty-widget-is .chaty-widget-i.is-in-desktop:not(.is-in-mobile)").remove(); }else{ jQuery(".chaty-widget-is .chaty-widget-i.is-in-mobile:not(.is-in-desktop)").remove(); } set_trigger_variables(); var activeWidget=jQuery("#chaty-channel-box-"+thisIndex).find(".chaty-widget-i").length; if(activeWidget==0){ jQuery("#chaty-widget-"+thisIndex).remove(); }else if(activeWidget==1){ var htmlToAdd=jQuery("#chaty-channel-box-"+thisIndex+" .chaty-widget-i:first").clone(); jQuery("#chaty-widget-"+thisIndex).find(".i-trigger").html(htmlToAdd); jQuery("#chaty-widget-"+thisIndex).addClass("one_widget"); jQuery("#chaty-widget-"+thisIndex).find(".i-trigger .chaty-widget-i-title p").text(chaty_settings.chaty_widgets[thisIndex]['cta']); jQuery("#chaty-widget-"+thisIndex).find(".i-trigger").addClass("one-widget"); } jQuery("#chaty-widget-"+thisIndex+" .i-trigger svg, #chaty-widget-"+thisIndex+" .i-trigger img").wrap(function(){ return "
    "; }); if(chaty_settings.chaty_widgets[thisIndex]['font_family']!=""){ jQuery("head").append(""); jQuery("#chaty-widget-"+thisIndex).css("font-family", chaty_settings.chaty_widgets[thisIndex]['font_family']); } var CTAStatus=get_cta_status(thisIndex); if(!CTAStatus){ jQuery("#chaty-widget-"+thisIndex+" .i-trigger .i-trigger-open").addClass("no-tooltip"); jQuery("#chaty-widget-"+thisIndex+" .i-trigger.one-widget").addClass("no-tooltip"); set_cta_status(thisIndex); } if(chaty_settings.chaty_widgets[thisIndex]['animation_class']!=""){ var widgetIndex=chaty_settings.chaty_widgets[thisIndex].widget_index; var animationStatus=is_chaty_settings_expired("ca"+widgetIndex); if(animationStatus){ jQuery("#chaty-animation-"+thisIndex).addClass("chaty-animation-"+chaty_settings.chaty_widgets[thisIndex]['animation_class']); }} jQuery("#chaty-widget-"+thisIndex).addClass(chaty_settings.chaty_widgets[thisIndex]['mode']+"-cht-menu"); jQuery("#chaty-widget-"+thisIndex).addClass(chaty_settings.chaty_widgets[thisIndex]['pos_side']+"-cht-position"); if(chaty_settings.chaty_widgets[thisIndex]['pos_side']=="right"){ jQuery("#chaty-widget-" + thisIndex).addClass("chaty-widget-is-left"); jQuery("#chaty-widget-" + thisIndex).css({ left: "auto", right: chaty_settings.chaty_widgets[thisIndex]['side']+"px", bottom: chaty_settings.chaty_widgets[thisIndex]['bot']+"px" }); }else{ jQuery("#chaty-widget-" + thisIndex).addClass("chaty-widget-is-right"); jQuery("#chaty-widget-" + thisIndex).css({ right: "auto", left: chaty_settings.chaty_widgets[thisIndex]['side']+"px", bottom: chaty_settings.chaty_widgets[thisIndex]['bot']+"px" }) } var widgetIndex=chaty_settings.chaty_widgets[thisIndex].widget_index; var displayStatus=is_chaty_settings_expired("cs"+widgetIndex); if(!displayStatus){ jQuery("#chaty-widget-"+thisIndex).removeClass("hide-widget"); chaty_settings.widget_status[thisIndex]['is_displayed']=1; trigget_widget_displayed_status(thisIndex); }else{ if(chaty_settings.chaty_widgets[thisIndex]['time_trigger']=="no"&&chaty_settings.chaty_widgets[thisIndex]['exit_intent']=="no"&&chaty_settings.chaty_widgets[thisIndex]['on_page_scroll']=="no"){ save_chaty_settings("cs"+widgetIndex); jQuery("#chaty-widget-"+thisIndex).removeClass("hide-widget"); chaty_settings.widget_status[thisIndex]['is_displayed']=1; trigget_widget_displayed_status(thisIndex); } if(chaty_settings.chaty_widgets[thisIndex]['time_trigger']=="yes"&&parseInt(chaty_settings.chaty_widgets[thisIndex]['trigger_time']) <=0){ save_chaty_settings("cs"+widgetIndex); jQuery("#chaty-widget-"+thisIndex).removeClass("hide-widget"); chaty_settings.widget_status[thisIndex]['is_displayed']=1; trigget_widget_displayed_status(thisIndex); } if(chaty_settings.chaty_widgets[thisIndex]['on_page_scroll']=="yes"&&parseInt(chaty_settings.chaty_widgets[thisIndex]['page_scroll']) <=0){ save_chaty_settings("cs"+widgetIndex); jQuery("#chaty-widget-"+thisIndex).removeClass("hide-widget"); chaty_settings.widget_status[thisIndex]['is_displayed']=1; trigget_widget_displayed_status(thisIndex); }} if(chaty_settings.chaty_widgets[thisIndex]['display_state']=="open"){ if(!jQuery("#chaty-widget-"+thisIndex).hasClass("one_widget")){ jQuery("#chaty-widget-"+thisIndex).removeClass("none-widget-show").addClass("chaty-widget-show"); } jQuery("#chaty-widget-"+thisIndex+" .i-trigger.one-widget, #chaty-widget-"+thisIndex+" .i-trigger .i-trigger-open").addClass("no-tooltip"); jQuery("#chaty-widget-"+thisIndex+" .i-trigger .i-trigger-open").addClass("true"); if(chaty_settings.chaty_widgets[thisIndex]['has_close_button']=="no"){ jQuery("#chaty-widget-"+thisIndex).addClass("has-not-close-button"); if(!jQuery("#chaty-widget-"+thisIndex).hasClass("one_widget")){ jQuery("#chaty-widget-"+thisIndex+" .i-trigger").remove(); }} }else if(chaty_settings.chaty_widgets[thisIndex]['display_state']=="hover"){ jQuery(document).on("mouseenter", ".i-trigger .i-trigger-open" , function(){ if(!jQuery(this).hasClass("hover-action")&&(jQuery(this).closest(".chaty-widget").hasClass("none-widget-show")||!jQuery(this).closest(".chaty-widget").hasClass("chaty-widget-show"))){ if(!jQuery(this).closest(".chaty-widget").hasClass("one_widget")){ jQuery(this).closest(".chaty-widget").removeClass("none-widget-show").addClass("chaty-widget-show"); } jQuery(this).addClass("no-tooltip"); jQuery(this).addClass("hover-action"); var thisIndex=jQuery(this).closest(".chaty-widget").attr("data-index"); set_cta_status(thisIndex); var widgetIndex=chaty_settings.chaty_widgets[thisIndex].widget_index; save_chaty_settings("ca" + widgetIndex); if(chaty_settings.chaty_widgets[thisIndex]['animation_class']!=""){ jQuery("#chaty-animation-" + thisIndex).removeClass("chaty-animation-" + chaty_settings.chaty_widgets[thisIndex]['animation_class']); }} }); } jQuery(".chaty-widget-i-title").each(function (){ if(jQuery(this).text()==""){ jQuery(this).closest(".chaty-widget-i").addClass("hide-chaty-arrow"); jQuery(this).remove(); }}); } function exit_intent_function(){ function addEvent(obj, evt, fn){ if(obj.addEventListener){ obj.addEventListener(evt, fn, false); } else if(obj.attachEvent){ obj.attachEvent("on" + evt, fn); }} addEvent(document, 'mouseout', function (evt){ if(evt.toElement==null&&evt.relatedTarget==null){ trigger_exit_intent(); }}); } function get_cta_status(widget_index){ var widgetIndex=chaty_settings.chaty_widgets[widget_index].widget_index; var cookieStr="cta"+widgetIndex; var cookieValue=check_for_chaty_settinigs(cookieStr); if(cookieValue!=null&&cookieValue!=""){ cookieValue=new Date(cookieValue); var diffTime=Math.abs(new Date() - cookieValue); var diffMin=Math.floor(diffTime / (1000 * 60)); if(diffMin >=10){ return true; }else{ return false; }} return true; } function check_for_chaty_settinigs(cookieStr){ var cookieString=get_chaty_cookie("chaty_settings"); var cookieArray=[]; if(cookieString!=null&&cookieString!=""){ cookieArray=JSON.parse(cookieString); } if(cookieArray.length > 0){ for(var i=0; i 0){ for(var i=0; i=1){ return true; }else{ return false; }} return true; } function trigger_exit_intent(){ if(exitIntentStatus){ for (var i=0; i < chaty_settings.chaty_widgets.length; i++){ if(chaty_settings.chaty_widgets[i]['exit_intent']=="yes"&&chaty_settings.widget_status[i]['is_displayed']==0){ jQuery("#chaty-widget-" + i).removeClass("hide-widget"); trigget_widget_displayed_status(i); var widgetIndex=chaty_settings.chaty_widgets[i].widget_index; save_chaty_settings("cs" + widgetIndex); chaty_settings.widget_status[i]['is_displayed']=1; chaty_settings.chaty_widgets[i]['exit_intent']="no"; jQuery("#chaty-widget-" + i).append("
    "); jQuery("#chaty-widget-" + i + " .chaty-nav").addClass(chaty_settings.chaty_widgets[i]['pos_side']); launch_chaty(i+1); setTimeout(function(){ jQuery(".chaty-nav").addClass("active"); }, 100); setTimeout(function(){ jQuery(".chaty-nav").remove(); }, 2500); }} set_trigger_variables(); }} function time_interval_function(){ if(timeIntervalStatus){ for (var i=0; i < chaty_settings.chaty_widgets.length; i++){ if(chaty_settings.chaty_widgets[i]['time_trigger']=="yes"&&chaty_settings.widget_status[i]['is_displayed']==0){ var timeToDisplay=parseInt(chaty_settings.chaty_widgets[i]['trigger_time'])*1000; if(timeToDisplay <=maxTimeInterval){ jQuery("#chaty-widget-" + i).removeClass("hide-widget"); trigget_widget_displayed_status(i); var widgetIndex=chaty_settings.chaty_widgets[i].widget_index; save_chaty_settings("cs" + widgetIndex); chaty_settings.widget_status[i]['is_displayed']=1; chaty_settings.chaty_widgets[i]['time_trigger']="no"; }} } set_trigger_variables(); maxTimeInterval=maxTimeInterval+100; if(timeIntervalStatus){ setTimeout(function(){ time_interval_function(); }, 100); }} } function page_scroll_functions(){ jQuery(window).scroll(function (){ if(pageScrollStatus){ var scrollHeight=jQuery(document).height() - jQuery(window).height(); var scrollPos=jQuery(window).scrollTop(); if(scrollPos!=0){ var scrollPer=((scrollPos / scrollHeight) * 100); for (var i=0; i < chaty_settings.chaty_widgets.length; i++){ if(chaty_settings.chaty_widgets[i]['on_page_scroll']=="yes"&&chaty_settings.widget_status[i]['is_displayed']==0){ var widgetScroll=parseInt(chaty_settings.chaty_widgets[i]['page_scroll']); if(scrollPer >=widgetScroll){ jQuery("#chaty-widget-" + i).removeClass("hide-widget"); trigget_widget_displayed_status(i); var widgetIndex=chaty_settings.chaty_widgets[i].widget_index; save_chaty_settings("cs" + widgetIndex); chaty_settings.widget_status[i]['is_displayed']=1; chaty_settings.chaty_widgets[i]['on_page_scroll']="no"; }} } set_trigger_variables(); }} }); } function clear_trigger_variables(){ pageScrollStatus=false; timeIntervalStatus=false; exitIntentStatus=false; } function set_trigger_variables(){ clear_trigger_variables(); jQuery(".chaty-widget").each(function(){ var thisIndex=jQuery(this).attr("data-index"); if(chaty_settings.widget_status[thisIndex]['on_page_status']==1&&chaty_settings.widget_status[thisIndex]['is_displayed']==0){ if(chaty_settings.chaty_widgets[thisIndex]['time_trigger']=="yes"){ if(parseInt(chaty_settings.chaty_widgets[thisIndex]['trigger_time']) > 0){ timeIntervalStatus=true; }else{ chaty_settings.chaty_widgets[thisIndex]['time_trigger']=="no"; }} if(chaty_settings.chaty_widgets[thisIndex]['on_page_scroll']=="yes"){ if(parseInt(chaty_settings.chaty_widgets[thisIndex]['page_scroll']) > 0){ pageScrollStatus=true; }else{ chaty_settings.chaty_widgets[thisIndex]['on_page_scroll']=="no"; }} if(chaty_settings.chaty_widgets[thisIndex]['exit_intent']=="yes"){ exitIntentStatus=true; }} }); } function set_chaty_widget_size(){ if(jQuery(".chaty-channels").length){ jQuery(".chaty-channels").each(function(){ var thisIndex=parseInt(jQuery(this).attr("data-index")); var widgetSize=parseInt(chaty_settings.chaty_widgets[thisIndex]['widget_size']); var totalWidget=parseInt(jQuery(this).find(".chaty-widget-i.is-in-desktop").length); if(!jQuery("body").hasClass("chaty-in-desktop")){ totalWidget=parseInt(jQuery(this).find(".chaty-widget-i.is-in-mobile").length); } jQuery(this).find(".chaty-widget-i").css({ height: widgetSize+"px", width: widgetSize+"px" }).find("img").css({ height: widgetSize+"px", width: widgetSize+"px" }).find("span").css({ height: widgetSize+"px", width: widgetSize+"px" }); jQuery("#chaty-widget-"+thisIndex+" .chaty-widget-i, #chaty-widget-"+thisIndex+" .i-trigger .i-trigger-open, #chaty-widget-"+thisIndex+" .i-trigger .i-trigger-close, #chaty-widget-"+thisIndex+" .i-trigger .animation-svg").css({ height: widgetSize+"px", width: widgetSize+"px" }); jQuery(this).css({top: "-" + 100 * totalWidget + "%"}); if(chaty_settings.chaty_widgets[thisIndex].mode=="horizontal"){ jQuery(this).css({top: "0"}); jQuery(this).width(totalWidget * (parseInt(widgetSize) + 8)); jQuery(this).height(parseInt(widgetSize) + 8); }else{ jQuery(this).height(totalWidget * (parseInt(widgetSize) + 8)); jQuery(this).width(parseInt(widgetSize) + 8); }}); }} function check_for_time(){ var displayStatus=0; if(parseInt(chaty_settings.object_settings.display_conditions)==1){ var displayRules=chaty_settings.object_settings.display_rules; if(displayRules.length > 0){ var localDate=new Date(); localDate.setHours(localDate.getHours() + (chaty_settings.object_settings.gmt)); var utcHours=localDate.getUTCHours(); var utcMin=localDate.getUTCMinutes(); var utcDay=localDate.getUTCDay(); for (var rule=0; rule < displayRules.length; rule++){ var hourStatus=0; var minStatus=0; var checkForTime=0; if(displayRules[rule].days==-1){ checkForTime=1; }else if(displayRules[rule].days >=0&&displayRules[rule].days <=6){ if(displayRules[rule].days==utcDay){ checkForTime=1; }}else if(displayRules[rule].days==7){ if(utcDay >=0&&utcDay <=4){ checkForTime=1; }}else if(displayRules[rule].days==8){ if(utcDay >=1&&utcDay <=5){ checkForTime=1; }}else if(displayRules[rule].days==9){ if(utcDay==5||utcDay==6){ checkForTime=1; }} if(checkForTime==1){ if(utcHours > displayRules[rule].start_hours&&utcHours < displayRules[rule].end_hours){ hourStatus=1; }else if(utcHours==displayRules[rule].start_hours&&utcHours < displayRules[rule].end_hours){ if(utcMin >=displayRules[rule].start_min){ hourStatus=1; }}else if(utcHours > displayRules[rule].start_hours&&utcHours==displayRules[rule].end_hours){ if(utcMin <=displayRules[rule].end_min){ hourStatus=1; }}else if(utcHours==displayRules[rule].start_hours&&utcHours==displayRules[rule].end_hours){ if(utcMin >=displayRules[rule].start_min&&utcMin <=displayRules[rule].end_min){ hourStatus=1; }} if(hourStatus==1){ if(utcMin >=displayRules[rule].start_min&&utcMin <=displayRules[rule].end_min){ minStatus=1; }} } if(hourStatus==1&&checkForTime==1){ displayStatus=1; } if(displayStatus==1){ rule=displayRules.length + 1; }} }else{ displayStatus=1; }}else{ displayStatus=1; } return displayStatus; } function set_chaty_widget(widgetIndex){ ""!=i("display_cta"), token="", jQuery(document).ready(function (){ "true"==e.object_settings.active&&(function (e, n){ var o=e.object_settings.device, a=""; if("right"==e.object_settings.position) a="left: auto;bottom: 25px; right: 25px;"; else if("left"==e.object_settings.position) a="right: auto; bottom: 25px; left: 25px;"; else if("custom"==e.object_settings.position){ var c=e.object_settings.pos_side, s=e.object_settings.bot, r=e.object_settings.side; a="right"===c ? "left: auto; bottom: " + s + "px; right: " + r + "px":"left: " + r + "px; bottom: " + s + "px; right: auto" } var g=e.object_settings.cta, d="", l=e.object_settings.social; if(Object.keys(l).length >=1&&(d='
    ', d +='
    '), d +=function (e){ var i="", n=0; return t.each(e.object_settings.social, function (t, o){ if(e.object_settings.isPRO&&jQuery("body").addClass("has-pro-version"), !e.object_settings.isPRO&&"3"==++n) return !1; extra_class="", "1"!=e.object_settings.analytics&&1!=e.object_settings.analytics||(extra_class +=" update-analytics "); var desktopClass=(e.object_settings.social[t].is_desktop==1) ? "is-in-desktop":""; var mobileClass=(e.object_settings.social[t].is_mobile==1) ? "is-in-mobile":""; var targetAction=(e.object_settings.is_mobile==1) ? e.object_settings.social[t].mobile_target:e.object_settings.social[t].desktop_target; if(jQuery("body").hasClass("chaty-in-mobile")){ e.object_settings.social[t].href_url=e.object_settings.social[t].mobile_url; } var onclick_settings=""; if(e.object_settings.social[t].on_click!=""){ onclick_settings=' onclick="'+e.object_settings.social[t].on_click+'"'; } if(e.object_settings.social[t].channel_type=="viber"){ if(jQuery("body").hasClass("chaty-in-mobile")){ var viberVal=e.object_settings.social[t].href_url; viberVal=viberVal.replace("+", ""); if(navigator.userAgent.match(/(iPod|iPhone|iPad)/)){ viberVal="+" + viberVal; } e.object_settings.social[t].href_url=viberVal; } e.object_settings.social[t].href_url="viber://chat?number=" + e.object_settings.social[t].href_url; } extra_class +=" "+e.object_settings.social[t].channel_type+"-action-btn "; extra_class +=" "+e.object_settings.social[t].social_channel+"-"+widgetIndex+"-channel "; socialString='
    ', bgColor="", ""!=e.object_settings.social[t].bg_color&&(socialString +="", bgColor="style='background-color: " + e.object_settings.social[t].bg_color + ";'"), socialString +="", ""!=e.object_settings.social[t].img_url ? socialString +="" + e.object_settings.social[t].title + "":socialString +=e.object_settings.social[t].default_icon, socialString +="", socialString +="

    " + e.object_settings.social[t].title + "

    ", socialString +="
    "; i +=socialString; }), i }(e), l=e.object_settings.social, Object.keys(l).length >=1){ d +="
    ", d +='
    '; var h=i("display_cta"); var CU=current_url=window.location.origin; CU=CU.replace("https://", ""); CU=CU.replace("http://", ""); if(""!=g&&"none"!=h) var p="true"; else p="no-tooltip"; d +='
    ', d +=function (t){ switch (t.object_settings.widget_type){ case"chat-image": if(t.object_settings.widget_img.length > 1) return '
    '; case"chat-smile": return ''; case"chat-bubble": return ''; case"chat-db": return ''; default: return '' }}(e), h=i("display_cta"), ""!=g&&"none"!=h&&(d +='
    ', d +=g, d +="
    "), d +="
    ", d +='
    ', ""==e.object_settings.close_img ? (d +='', d +='', d +='', d +='', d +=""):d +="" + e.object_settings.close_text + "", d +='
    ', d +=e.object_settings.close_text, d +="
    ", d +="
    ", d +="
    ", 0===n.length&&!e.object_settings.isPRO&&(d +=''), d +="
    "; } else ; t("body").append(d); set_chaty_channels(widgetIndex); load_chaty_functions(); set_chaty_widget_size(); }(e, token)); }); } function set_cta_status(widget_index){ var widgetIndex=chaty_settings.chaty_widgets[widget_index].widget_index; var cookieStr="cta"+widgetIndex; var cookieString=get_chaty_cookie("chaty_settings"); var cookieArray=[]; if(cookieString!=null&&cookieString!=""){ cookieArray=JSON.parse(cookieString); } var cookieFound=false; if(cookieArray.length > 0){ for(var i=0; i 0){ for(var i=0; i 0){ for(var i=0; i=2){ return true; }else{ return false; }} return true; } function trigget_widget_displayed_status(widget_index){ if(!isBoatUser){ var widgetIndex=chaty_settings.chaty_widgets[widget_index].widget_index; var widgetNonce=chaty_settings.chaty_widgets[widget_index].widget_nonce; var isExpired=check_chaty_cookie_expired("cwds"+widgetIndex); if(isExpired){ save_chaty_cookie_string("cwds"+widgetIndex); var socialChannels=""; if(jQuery("#chaty-widget-" + widgetIndex).hasClass("single_widget")){ if(jQuery("#chaty-widget-" + widget_index + " .i-trigger.one-widget > .chaty-main-widget").length){ var channelKey="cwds" + widgetIndex + "_" + jQuery("#chaty-widget-" + widget_index + " .i-trigger.one-widget > .chaty-main-widget").attr("data-channel"); if(check_chaty_cookie_expired(channelKey)){ socialChannels=jQuery("#chaty-widget-" + widget_index + " .i-trigger.one-widget > .chaty-main-widget").attr("data-channel"); save_chaty_cookie_string(channelKey); }} }else{ jQuery("#chaty-widget-" + widget_index + " .chaty-channels").find(".chaty-main-widget").each(function (){ var channelKey="cwds" + widgetIndex + "_" + jQuery(this).attr("data-channel"); if(check_chaty_cookie_expired(channelKey)){ socialChannels +=jQuery(this).attr("data-channel") + ","; save_chaty_cookie_string(channelKey); }}); } jQuery.ajax({ url: chaty_settings.ajax_url, data: "index=" + widgetIndex + "&nonce=" + widgetNonce + "&is_widget=1&channel=&type=view&action=update_chaty_channel_status&channels=" + socialChannels, type: 'post', async: true, defer: true, success: function (){ }}); }else{ var socialChannels=""; if(jQuery("#chaty-widget-" + widget_index).hasClass("single_widget")){ if(jQuery("#chaty-widget-" + widget_index + " .i-trigger.one-widget > .chaty-main-widget").length){ var channelKey="cwds" + widgetIndex + "_" + jQuery("#chaty-widget-" + widget_index + " .i-trigger.one-widget > .chaty-main-widget").attr("data-channel"); if(check_chaty_cookie_expired(channelKey)){ socialChannels=jQuery("#chaty-widget-" + widget_index + " .i-trigger.one-widget > .chaty-main-widget").attr("data-channel"); save_chaty_cookie_string(channelKey); }} }else{ jQuery("#chaty-widget-" + widget_index + " .chaty-channels").find(".chaty-main-widget").each(function (){ channelKey="cwds" + widgetIndex + "_" + jQuery(this).attr("data-channel"); if(check_chaty_cookie_expired(channelKey)){ socialChannels +=jQuery(this).attr("data-channel") + ","; save_chaty_cookie_string("cwds" + widgetIndex + "_" + jQuery(this).attr("data-channel")) }}); } if(socialChannels!=""){ jQuery.ajax({ url: chaty_settings.ajax_url, data: "index=" + widgetIndex + "&nonce=" + widgetNonce + "&is_widget=1&channel=&type=view&action=update_chaty_channel_view&channels=" + socialChannels+"&for=channels", type: 'post', async: true, defer: true, success: function (){ }}); }} }} }(jQuery); }, 12: function (t, e){ }}); function launch_chaty(widget_number){ if(widget_number==undefined||widget_number=="widget_index"){ widget_number=1; } widget_number=parseInt(widget_number); var selected_widget=-1; if(chaty_settings.chaty_widgets.length > 0){ for(var i=0; i -1){ if(jQuery("#chaty-widget-"+selected_widget).length){ jQuery("#chaty-widget-"+selected_widget).removeClass("hide-widget"); trigget_widget_displayed_status(selected_widget); jQuery("#chaty-widget-"+selected_widget+" .i-trigger .i-trigger-open").trigger("click"); }}else{ console.log("widget not exists on this page"); }};